class Message {
    #message = "Jack"
    
    greet() {
        console.log(this.#message)
    }
}

const greeting = new Message()

greeting.greet()  // Jack
// console.log(greeting.#message) // Private name #message is not defined
